package com.ld.caodan.client;

import java.io.IOException;

import org.apache.http.client.ClientProtocolException;

import com.ld.caodan.client.IClient.ClientType;
import com.ld.caodan.client.impl.CCHttpClient;
import com.ld.caodan.client.impl.CCURLClient;

/**
 * 
 * 由于该客户端只用实现简单的请求<br>
 * 所以没有进行session维持操作
 * 
 * @author 刘笛 2011-9-15 上午09:21:30
 */
public class BasicClient {

    public static IClient getHttpClient(ClientType clientType) {
	if(clientType.equals(ClientType.HTTPClient)) return new CCHttpClient();
	if(clientType.equals(ClientType.URLClient)) return new CCURLClient();
	return null;
    }
    
    public static void main(String[] args) throws ClientProtocolException, IOException {
	IClient client = new CCHttpClient();
	System.out.println(client.doGet("http://www.baidu.com"));
    }

}
